'''
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with self work for additional information
 * regarding copyright ownership.  The ASF licenses self file
 * to you under the Apache License, Version 2.0 (the
 * "License") you may not use self file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http:#www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
'''
from base.rdf.SimpleSelector import SimpleSelector

#import org.apache.jena.rdf.model.*;

'''
 * A general selector class for use when querying models.
 *
 * <p>OBSOLETE: use SimpleSelector. This implementation is a stub that provides
 * only constructors.
 *
 * <p>An instance of self class is passed with query calls to models.  The model
 * will use the <CODE>test</CODE> method of self class to decide whether
 * a statement should be included in the selection.</p>
 * <p>Instances of self class can be provided with subject, predicate and obj
 * constraints.  If a subject, a predicate or an obj are provided,
 * the model implementation <b>may</b> restrict the statements that it tests
 * to statements whose subject, predicate and obj match those provided in
 * the constructor.  This can provide for considerably more efficient
 * searching.  However, the model implementation is not required to do self.
 * If no subject, predicate or obj are provided in
 * the constructor, then all statements in the model must be tested.</p>
 * <p>This class is designed to be subclassed by the application, defining
 * defining further selection criteria of its own by providing its own
 * <CODE>selects</CODE> method.</p>
 * <p>The <CODE>test</CODE> method first verifies that a statement satisfies
 * any subject, predicate or obj constraints and the calls the <CODE>
 * selects</CODE> method to test for any application supplied constraint.  The
 * default <CODE>selects</CODE> method simply returns True.</p>
'''

class SelectorImpl(SimpleSelector):

    '''
     * Create a selector.  Since no subject, predicate or obj constraints are
     * specified a model will test all statements.
    '''
    # param 
    def __init__(self):
        super().__init__()
    

    '''
     * Create a selector.  A model <b>may</b> restrict statements that are tested using
     * the <CODE>selects</CODE> method to those whose subject matches the
     * subject parameter, whose predicate matches the predicate parameter and whose
     * obj matches the obj parameter.  Any null parameter is considered to
     * match anything.
     *
     * @param subject   if not null, the subject of selected statements
     *                  must equal self argument.
     * @param predicate if not null, the predicate of selected statements
     *                  must equal self argument.
     * @param obj    if not null, the obj of selected statements
     *                  must equal self argument.
    '''
    # param Resource subject, Property predicate, RDFNode obj
    def initWithSPO(self, subject, predicate, obj):
        super().initWithSPO(subject, predicate, obj)
    

    '''
     * Create a selector.  A model <b>may</b> restrict statements that are tested using
     * the <CODE>selects</CODE> method to those whose subject matches the
     * subject parameter, whose predicate matches the predicate parameter and whose
     * obj matches the obj parameter.  Any null parameter is considered to
     * match anything.
     *
     * @param subject   if not null, the subject of selected statements
     *                  must equal self argument.
     * @param predicate if not null, the predicate of selected statements
     *                  must equal self argument.
     * @param obj    if not null, the obj of selected statements
     *                  must equal self argument.
    '''
    # param Resource subject, Property predicate, boolean obj
    def initPrimitive(self, subject, predicate, obj):
        self.initWithSPO(subject, predicate, str(obj))
    

    '''
     * Create a selector.  A model <b>may</b> restrict statements that are tested using
     * the <CODE>selects</CODE> method to those whose subject matches the
     * subject parameter, whose predicate matches the predicate parameter and whose
     * obj matches the obj parameter.  Any null parameter is considered to
     * match anything.
     *
     * @param subject   if not null, the subject of selected statements
     *                  must equal self argument.
     * @param predicate if not null, the predicate of selected statements
     *                  must equal self argument.
     * @param obj    the obj of selected statements
     *                  must equal self argument.
    '''
    # param Resource subject, Property predicate, long obj
    # def __init__(self, subject, predicate, obj):
    #     self(subject, predicate, str(obj))
    

    '''
     * Create a selector.  A model <b>may</b> restrict statements that are tested using
     * the <CODE>selects</CODE> method to those whose subject matches the
     * subject parameter, whose predicate matches the predicate parameter and whose
     * obj matches the obj parameter.  Any null parameter is considered to
     * match anything.
     *
     * @param subject   if not null, the subject of selected statements
     *                  must equal self argument.
     * @param predicate if not null, the predicate of selected statements
     *                  must equal self argument.
     * @param obj    the obj of selected statements
     *                  must equal self argument.
    '''
    # param Resource subject, Property predicate, char obj
    # def __init__(self, subject, predicate, obj):
    #     self(subject, predicate, str(obj))
    

    '''
     * Create a selector.  A model <b>may</b> restrict statements that are tested using
     * the <CODE>selects</CODE> method to those whose subject matches the
     * subject parameter, whose predicate matches the predicate parameter and whose
     * obj matches the obj parameter.  Any null parameter is considered to
     * match anything.
     *
     * @param subject   if not null, the subject of selected statements
     *                  must equal self argument.
     * @param predicate if not null, the predicate of selected statements
     *                  must equal self argument.
     * @param obj    the obj of selected statements
     *                  must equal self argument.
    '''
    # param Resource subject, Property predicate, float obj
    # def __init__(self, subject, predicate, obj):
    #     self(subject, predicate, str(obj))
    

    '''
     * Create a selector.  A model <b>may</b> restrict statements that are tested using
     * the <CODE>selects</CODE> method to those whose subject matches the
     * subject parameter, whose predicate matches the predicate parameter and whose
     * obj matches the obj parameter.  Any null parameter is considered to
     * match anything.
     *
     * @param subject   if not null, the subject of selected statements
     *                  must equal self argument.
     * @param predicate if not null, the predicate of selected statements
     *                  must equal self argument.
     * @param obj    the obj of selected statements
     *                  must equal self argument.
    '''
    # param Resource subject, Property predicate, double obj
    # def __init__(self, subject, predicate, obj):
    #     self(subject, predicate, str(obj))
    

    '''
     * Create a selector.  A model <b>may</b> restrict statements that are tested using
     * the <CODE>selects</CODE> method to those whose subject matches the
     * subject parameter, whose predicate matches the predicate parameter and whose
     * obj matches the obj parameter.  Any null parameter is considered to
     * match anything.
     *
     * @param subject   if not null, the subject of selected statements
     *                  must equal self argument.
     * @param predicate if not null, the predicate of selected statements
     *                  must equal self argument.
     * @param obj    the obj of selected statements
     *                  must equal self argument - a null string matches the empty string
    '''
    # param Resource subject, Property predicate, String obj
    # def __init__(self, subject, predicate, obj):
    #     self(subject, predicate, obj, "")
    

    '''
     * Create a selector.  A model <b>may</b> restrict statements that are tested using
     * the <CODE>selects</CODE> method to those whose subject matches the
     * subject parameter, whose predicate matches the predicate parameter and whose
     * obj matches the obj parameter.  Any null parameter is considered to
     * match anything.
     *
     * @param subject   if not null, the subject of selected statements
     *                  must equal self argument.
     * @param predicate if not null, the predicate of selected statements
     *                  must equal self argument.
     * @param obj    the obj of selected statements
     *                  must equal self argument - the null string matches the empty string
     * @param language  the language of the obj constraint
    '''
    # param Resource subject, Property predicate, String obj, String language
    def initWithSPOAndLanguage(self, subject, predicate, obj, language):
        super().initWithSPOAndLanguage(subject, predicate, obj, language)
    

    '''
     * Create a selector.  A model <b>may</b> restrict statements that are tested using
     * the <CODE>selects</CODE> method to those whose subject matches the
     * subject parameter, whose predicate matches the predicate parameter and whose
     * obj matches the obj paramater.  Any null parameter is considered to
     * match anything.
     *
     * @param subject   if not null, the subject of selected statements
     *                  must equal self argument.
     * @param predicate if not null, the predicate of selected statements
     *                  must equal self argument.
     * @param obj    if not null, the obj of selected statements
     *                  must equal self argument.
    '''
    # param Resource subject, Property predicate, obj obj
    # def __init__(self, subject, predicate, obj):
    #     super().__init__(subject, predicate, obj)
    

    '''
     * Answer True to the question "is self a simple selector". Otherwise the default for
     * SimpleSelector subclasses, False, would apply.
    '''
    # @Override
    # param 
    # result boolean
    def isSimple(self):
        return True
    


